Polymorphic Dynamic Typing
نویسنده
چکیده
We study dynamic typing in continuation of Henglein’s dynamically typed λ-calculus, with particular regard to proof theoretic aspects and aspects of polymorphic completion inference. Dynamically typed λ-calculus provides a formal framework within which we can reason in a precise manner about properties of the process of completion for higher order programming languages. Completions arise from raw programs by insertion of type coercions which model runtime type operations of tagging and checking/untagging. Central among the problems studied in dynamic typing are the notions of minimization of run-time type coercions in completions and safety of completions. From the monomorphic framework of Henglein’s system, we work towards a polymorphic generalization which eventually comprises Hindley-Milner style polymorphism, discriminative, tagged sum types, regular recursive types and so-called coercive types with a notion of coercion parameterization. The resulting system can be seen as a form of polymorphic qualified type system which aims at a common generalization of dynamic typing and certain systems of soft typing. Starting from an equational presentation of categorical co-products, we develop a dynamic typing calculus within which we can reason about completion. We develop a generalized theory of conversion and reduction on coercions and completions. We establish fundamental proof theoretic properties of the calculus, including confluence of general completion reduction and existence and uniqueness of minimal completions in a pragmatically important class of completions. We also give a proof-theoretic treatment of a generalization of Thatte’s quasi-static typing which arises naturally in the framework of dynamic typing. We study problems of automatic completion inference in our generalized setting, and we describe an implementation of a simple, global dynamic type analysis. We investigate the problem of achieving modularity of inference, and we argue that safety and minimality are conflicting goals in a modular setting. It is suggested that the use of coercion parameters is an important ingredient in reconciling these goals. The problem of dynamic type inference for a realistic dynamically typed language is studied, with special reference to Scheme. Completion inference as a basis for static debugging tools and for a high-level translation of Scheme to ML is investigated. We identify major problems and suggest solutions to some of them.
منابع مشابه
Molecular Typing of Mycobacterium Tuberculosis Isolated from Iranian Patients Using Highly Abundant Polymorphic GC-Rich-Repetitive Sequence
Background: Tuberculosis (TB) with more than 10 million new cases per year and one of the top 10 causes of death worldwide, is still one of the most important global health problems. Also, multi drug-resistant tuberculosis (MDR) is a serious danger to public health. Understanding of the epidemiological pattern of mycobacterium tuberculosis (MTB), Estimates of recent transmission and recurrence ...
متن کاملPolymorphic Game Semantics for Dynamic Binding
We present a game semantics for an expressive typing system for block-structured programs with late binding of variables and System F style polymorphism. As well as generic programs and abstract datatypes, this combination may be used to represent behaviour such as dynamic dispatch and method overriding. We give a denotational models for a hierarchy of programming languages based on our typing ...
متن کاملCombining Recursive and Dynamic Types
A denotational semantics of simply typed lambda calculus with a basic type Dynamic, modelling values whose type is to be inspected at run-time, has been given by Abadi e.a..1]. We extend this interpretation to cover (formally contractive) recursive types as well. Soundness of typing rules and freeness of run-time type errors for well-typed programs hold. The interpretation works also for implic...
متن کاملCorrectness of compiling polymorphism to dynamic typing
The connection between polymorphic and dynamic typing was originally considered by Curry et al. (1972) in the form of “polymorphic type assignment” for untyped λ -terms. Types are assigned after the fact to what is, in modern terminology, a dynamic language. Interest in type assignment was revitalized by the proposals of Bracha et al. (1998) and Bank et al. (1997) to enrich Java with polymorphi...
متن کاملDynamic Typing in Polymorphic Languages Dynamic Typing in Polymorphic Languages Digital Equipment Corporation 1994
matching protects the identity of \hidden" representation types and prevents accidental matches in cases where several abstract types happen to have the same representation. On the other hand, transparent matching allows a more permissive style of programming, where a dynamically typed value of some abstract type is considered to be a value of a di erent version of \the same" abstract type. Thi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2005